package top.lanscarlos.ashcraft.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lanscarlos.ashcraft.service.OrderService;

/**
 * Ashcraft
 * top.lanscarlos.ashcraft.controller
 *
 * @author Lanscarlos
 * @since 2022-05-30 17:40
 */
@RestController
@RequestMapping("/order")
public class OrderController extends AshController {

    @Autowired
    private OrderService service;

    @RequestMapping("/query")
    public Object query(int userId) {
        return service.query(userId);
    }

    @RequestMapping("/purchase")
    public Object purchase(int userId) {
        return toJson(service.purchase(userId));
    }

}
